Skip to content

Add a flag to omit the output of commented call when using latex#33

Open
gragusa wants to merge 4 commits intoharrelfe:masterfrom
gragusa:master
Open

Add a flag to omit the output of commented call when using latex#33
gragusa wants to merge 4 commits intoharrelfe:masterfrom
gragusa:master

Conversation

@gragusa
Copy link
Copy Markdown

@gragusa gragusa commented Dec 4, 2015

I use latex to create complex tables using knitr. However, latex generated tables have the call added to the table's output by default as a comment. This is problematic because knitr sanitizes the comment marker % and thus the call is added as a test before the table.

This PR add a flag output.call (default value is FALSE) which excludes the problematic output.

@harrelfe
Copy link
Copy Markdown
Owner

harrelfe commented Dec 4, 2015

See the Hmisc package knitrSet function. As I haven't had this
particular problem I suspect one of the default options used by knitrSet
solved it.

Frank

On 12/04/2015 08:27 AM, Giuseppe Ragusa wrote:

I use |latex| to create complex tables using knitr. However, |latex|
generated tables have the |call| added to the table's output by
default as a comment. This is problematic because |knitr| sanitizes
the comment marker |%| and thus the call is added as a test before the
table.

This PR add a flag |output.call| (default value is |FALSE|) which
excludes the problematic output.


    You can view, comment on, or merge this pull request online at:

#33

    Commit Summary


Reply to this email directly or view it on GitHub
#33.


Frank E Harrell Jr Professor and Chairman School of Medicine

Department of *Biostatistics*   *Vanderbilt University*

@gragusa
Copy link
Copy Markdown
Author

gragusa commented Jun 30, 2016

The problem is there with markdown and not with latex literate file. The reason is that % does not initiate a comment in markdown.

@gragusa
Copy link
Copy Markdown
Author

gragusa commented Jun 30, 2016

I have changed the output.call to comment = TRUE which leave things as they were before this PR. When comment=FALSE the comment with the call output is not shown.

@harrelfe
Copy link
Copy Markdown
Owner

harrelfe commented Jul 1, 2016

Please state which function you are referring to and what PR means. I use knitr extensively and have never had a problem with this so please provide a trivial self-contained example that fails when running knitr to produce a .tex file.

@couthcommander
Copy link
Copy Markdown
Collaborator

Giuseppe has created a pull request (PR). He modified latex.default by adding a new argument, comment=TRUE. See the "Files Changed" tab at the top of this discussion (or https://github.com/harrelfe/Hmisc/pull/33/files).

@harrelfe
Copy link
Copy Markdown
Owner

I'm sorry that I've waiting so long to merge your pull request that there are now conflicts in the code. Would you mind re-doing the pull request on the latest version of Hmisc on github, and also making corresponding changes in the help file? Thanks for your efforts. -Frank

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Apr 25, 2022
Changes in version 4.7-0 (2022-04-18)
   * html.contents.data.frame: properly closed html <a>
   * simPOcuts: new function to demonstrate variation in odds ratios
     due to random chance
   * R2Measures: new function to compute various pseudo R^2 measures
   * putHcap: added new capabilities around the subsub argument
   * print.summary.formula.response: added markdown argument
   * knitrSet: added rudimentary quarto support
   * knitrSet: sense figure labels of the form fig-... used by Quarto,
     and generate correct cross-reference


Changes in version 4.6-0 (2021-10-05)
   * package: improved author formatting in DESCRIPTION

   * html: markupSpecs$html$session: added citations for any Harrell
     packages that are loaded, respecting current output format in
     effect with knitr

   * soprobMarkovOrdm: new function to compute state occupancy
     probabilities from proportion odds model fits

   * plotCorrM: new function to graph correlation matrices and gap
     time relationships using ggplot2

   * ggplotlyr: new function to use plotly::ggplotly to render ggplot2
     graphs but intercepting hover text to remove extraneous labels

   * Fixed Heiberger email address
   * propTrans: removed zero frequency combinations
   * combplotp: fixed bug in case regarding recognition of positives
nnn   * propsPO: fixed making y factor
   * soprobMarkovOrdm: added as.data.frame(generated data)

   * estSeqMarkovOrd: extended timecriterion function to allow user to
     return the event/censoring time and indicator, and to allow
     groupContrast to compute using a variance formula

   * estSeqMarkovOrd: trapped errors better, returning attribute
     failures, and added maxest and maxvest argument to declare large
     parameter or variance estimates as failed iterations; changed
     from vgam to vglm and sped up computations by using previous
     coefficient estimates as starting values

   * session in markupSpecs: added citations for several other packages
   * soprobMarkovOrdm: extended to work with VGAM package

   * describe: fix error with . (thanks to Cole Beck;
     harrelfe/Hmisc#144)

   * many: tests for presence of suggested packages using
     requireNamespace (thanks for major editing work by Duncan Murdoch
     at harrelfe/Hmisc#143 motivated by
     https://stat.ethz.ch/pipermail/r-package-devel/2021q2/007101.html)

   * mdb.get: fix for Windows by changing from system to system2
     (thanks to Rainer Hurling at
     harrelfe/Hmisc#135)

   * summaryM: fixed error with prN=TRUE with latex (thanks Matt
	 * Shotwell in harrelfe/Hmisc#109)
	 * many: fix partial argument matching warnings length ->
	 * length.out in rep (thanks Bill Denney in
	 * harrelfe/Hmisc#128)

   * rcspline.restate: was dropping + for exactly zero coefficients
     (thanks harrelfe/Hmisc#118)

   * mdb.get: remove brackets from table names (thanks
     harrelfe/Hmisc#123)

   * latex: added new argument comment so that the generated comment
     can be suppressed (thanks Giuseppe Ragusa
     harrelfe/Hmisc#33)

   * sas.get: added new argument for variable case (thanks Tyler Hunt
     harrelfe/Hmisc#8)

   * format.df: changed to use system option OutDec when cdot is not
     specified (thanks harrelfe/Hmisc#142)

   * C code: changed calls to warning/error routines

   * formatdescribeSingle: changed for character value to make 'NA' work

Changes in version 4.5-0 (2021-02-27)
   * approxExtrap: changed x and y to as.numeric.  Thanks: juha.heikkinen@luke.fi
   * upData: fix column subsetting for data.tables
   * dotchartpl: intercepted missing Diff

   * simMarkovOrd, soprobMarkovOrd, intMarkovOrd, estSeqMarkovOrd: new
     functions for Markov proportional odds model simulation and
     calculation of state occupancy probabilities

   * ggfreqScatter: added by argument
   * VGAM package added to Suggests in DESCRIPTION
   * html markupSpecs mdchunk: added caption argument, allowed for vectors

   * propsTrans: added labels argument for plotly, added numerators
     and denominators in tooltips, fixed bug where factor levels were
     reversed if odds.ratio specified

Changes in version 4.4-2 (2020-11-25)

   * rcorr: captured loss of precision leading to square root of a
     negative number.  Thanks: Ann Voss <avoss@novanthealth.org>

   * summaryS: sapply was doubling names

   * pairUpDiff: created for dotchartpl - function to pair up grouped
     observations for sorting by descending differences and computing
     approximate confidence intervals for the difference given
     individual confidence limits

   * dotchartpl: added new arguments and functionality to handle
     quantities other than proportions (e.g., hazards) and streamlined
     code using pairUpDiff

   * propsPO: added tooltip text for gpplot that will be transmitted
     to ggplotly; reversed order of categories so lowest category put
     at bottom of bar

   * dotchartpl: suppressed confidence intervals when the number of
     groups is not 2; fixed bug where hover text confidence intervals
     were repeats of the last computed interval instead of properly
     using all the intervals; added dec argument

   * added estSeqSim and gbayesSeqSim functions

   * ggfreqScatter: stopped varying alpha and just varied color, as
     alpha collided with the color scheme

   * histSpike: added minimal=TRUE and bins arguments

Changes in version 4.4-1 (2020-08-07)
   * popower: added approximate S.E. of log(OR) in results
   * propsPO: new function for exploring proportional odds

   * propsTrans: new function for showing distributions of successive
     state transitions
   * changed acepack to suggests
   * multEventChart: new function for multi-state event charts based
     on code written by Lucy D'Agostino McGowan
   * getHdata: changed to use hbiostat.org/data/repo

   * markupSpecs$markdown$tof: new function to render a table of
     figures with short captions

   * knitrSet: added capfile argument to store figure tags and short captions
   * getLatestSource: changed to use GitHub and hbiostat.org/R/packagename/dir.txt
   * histboxpM: added width argument
   * upData: handled zero-length subsets (Thanks: Will Gray)
   * upData: made faster for large datasets
   * ffCompress: removed from package and put in Github Rscripts
   * Changed maintainer email

Changes in version 4.4-0 (2020-03-22)
   * combplotp: new function for attribute plots with plotly
   * summaryP: made to work with new default stringsAsFactors=FALSE
   * plotlyM: fixed bug where need to unlist if only one graph produced
   * plotlyM: added ECDF support through fitter='ecdf'

   * keepHattrib, restoreHattrib: new functions for saving Hmisc
     attributes that can be restored later, e.g., after data.table
     processes a data frame

Changes in version 4.3-1 (2020-02-07)
   * Depend on survival >= 3.1-6
   * pomodm: checked that x is sorted
   * markupSpecs: added ord function for ordinal representation of integers
   * mChoice: removed unused argument sort. from help file

Changes in version 4.3-0 (2019-11-07)
   * Corrected typos in aregImpute help file.  Thanks: Mark Seeto.

   * describe: changed to print 5 lowest and highest values even if
     frequency table printed, added a line of printed output
     specifying any rounding done for the frequency table

   * vcov.fit.mult.impute: use vcov.orm if object has orm class.
     intercepts=mid logic was not working for this

   * New service function convertPdate to do automatic date
     conversions and handle partial dates such as YYYY and mm/YYYY
     with imputation, for cleanup.import

   * cleanup.import: new arguments autodate, autonum, fracnn

   * describe: formatted dates if there is only one distinct value;
     changed to sense date or date-times, for Gmd not format as
     date-time

   * plot.describe: treated date/time variables as numeric
   * cleanup.import: refined autonum considerNA
   * ggfreqScatter: added stick=TRUE argument

   * markupSpecs: changed math and similar functions to use
     ... argument instead of x

   * summaryDp: new function for plotly dotcharts stratifying
     separately on a series of variables

   * dotchartpl: added height argument

   * html.describe: fixed but where markupSpecs$html utility function
     last arguments were not named in calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants